package controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import utils.UtilFuncoes;
import br.com.jf.interfaces.JFExceptionHandler;

public class ShowcaseExceptionHandler implements JFExceptionHandler{

	@Override
	public void handleException(HttpServletRequest request,
			HttpServletResponse response, Exception exception)  {
	
			
			
			try {

				//Envia um controle que define o erro gerado para a pagina corrente
				request.setAttribute(UtilFuncoes.EXCEPTION_HANDLER, true);
				request.setAttribute(UtilFuncoes.DESC_EXCEPTION, exception.getMessage());
			
				
				response.sendRedirect(UtilFuncoes.URL_SITE + "/home.html?get=inicializarHome");
			
			
			} catch (IOException e) {
			
				e.printStackTrace();
			}
	}
	
	
}
